home *** CD-ROM | disk | FTP | other *** search
/ Building Homes of Our Own / Building Homes of our Own.iso / setup / data1.cab / Everything / working / houCons.dxr / interface_488_BuildMatDisplayActions.ls < prev    next >
Encoding:
Text File  |  2002-09-25  |  3.1 KB  |  105 lines

  1. property mySprite, myCurDisplayNum, myListToDisplay, numToDisplay, myCurDisplay, textDisplayField, progressDisplayField, ancestor
  2.  
  3. on new me, spriteNum, listToDisplay
  4.   mySprite = spriteNum
  5.   textDisplayField = "toolbarTextDisplayField"
  6.   progressDisplayField = "toolBarProgressDisplayField"
  7.   myListToDisplay = listToDisplay
  8.   myCurDisplayNum = 0
  9.   numToDisplay = count(myListToDisplay)
  10.   doNextDisplay(me)
  11.   return me
  12. end
  13.  
  14. on sendSpriteNum me, whichType
  15.   if whichType = me.myType then
  16.     return mySprite
  17.   end if
  18. end
  19.  
  20. on doNextDisplay me
  21.   if myCurDisplayNum = numToDisplay then
  22.     exit
  23.   end if
  24.   myCurDisplayNum = myCurDisplayNum + 1
  25.   myCurDisplay = myListToDisplay[myCurDisplayNum]
  26.   set the member of sprite mySprite to member(myCurDisplay)
  27.   updateOnScreenText(me)
  28.   if myCurDisplayNum = numToDisplay then
  29.     return #LastFootPrint
  30.   else
  31.     return 1
  32.   end if
  33. end
  34.  
  35. on doPreviousDisplay me
  36.   if myCurDisplayNum = 1 then
  37.     exit
  38.   end if
  39.   myCurDisplayNum = myCurDisplayNum - 1
  40.   myCurDisplay = myListToDisplay[myCurDisplayNum]
  41.   set the member of sprite mySprite to member(myCurDisplay)
  42.   updateOnScreenText(me)
  43.   if myCurDisplayNum = 1 then
  44.     return #FirstDisplay
  45.   else
  46.     return 1
  47.   end if
  48. end
  49.  
  50. on getCurDisplayStatus me
  51.   if myCurDisplayNum = 1 then
  52.     return #First
  53.   else
  54.     if myCurDisplayNum = numToDisplay then
  55.       return #last
  56.     else
  57.       return #mid
  58.     end if
  59.   end if
  60. end
  61.  
  62. on sendBuildingMaterial me
  63.   buildMat = word 3 of the name of the member of sprite mySprite
  64.   return symbol(buildMat)
  65. end
  66.  
  67. on updateOnScreenText me
  68.   global gToolBarTextMan
  69.   displayText = getInfoDisplayText(me, myCurDisplay)
  70.   progressText = myCurDisplayNum && "of" && numToDisplay
  71.   useString = 1
  72.   setToolBarText(gToolBarTextMan, displayText, useString)
  73.   put progressText into field progressDisplayField
  74. end
  75.  
  76. on getInfoDisplayText me, curDisplay
  77.   global gCostMan, gConMan
  78.   whichFinish = symbol(word 3 of curDisplay)
  79.   whichItems = symbol(word 2 of curDisplay)
  80.   case whichItems of
  81.     #efs:
  82.       numTiles = getCurWallLength(gConMan)
  83.       whichfloor = getCurFloor(gConMan)
  84.       costs = getWallCosts(gCostMan, numTiles, whichfloor, whichFinish)
  85.       displayString = "To choose this finish for this wall, hit the PURCHASE" && RETURN
  86.       put "button. Cost: " & formatMonetaryForDisplay(costs) after displayString
  87.       return displayString
  88.     #windows:
  89.       costs = getWindowCosts(gCostMan, whichFinish)
  90.       displayString = "To choose this material for all windows, hit the" & RETURN
  91.       put "PURCHASE button. Cost: " & formatMonetaryForDisplay(costs) after displayString
  92.       return displayString
  93.     #doors:
  94.       costs = getDoorCosts(gCostMan, whichFinish)
  95.       displayString = "To choose this material for all doors, hit the " & RETURN
  96.       put "PURCHASE button. Cost: " & formatMonetaryForDisplay(costs) after displayString
  97.       return displayString
  98.     #roof:
  99.       costs = getRoofCosts(gCostMan, whichFinish)
  100.       displayString = "To choose this material for your roof, hit the " & RETURN
  101.       put "PURCHASE button. Cost: " & formatMonetaryForDisplay(costs) after displayString
  102.       return displayString
  103.   end case
  104. end
  105.